package chapter7;

import utils.RegexPatternUtil;

import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author yuh
 * @date 2018/5/3 11:06
 * @description
 */
public class Regex1 {

    private static Pattern pattern = Pattern.compile("(\\d+),?");

    public static void main(String[] args) {
        String str = "[123,3445,6,7,7,8,8,8,99,99,9,00,0]";
       /* Matcher matcher = pattern.matcher(str);
        while (matcher.find()) {
            System.out.println(matcher.group(1));
        }*/

        List<Double> allMatches = RegexPatternUtil.getAllMatches(str, "(\\d+),?", 1, Double.class);
        System.out.println(allMatches);
    }
}
